Skip to content

DateTime add error render ability#888

Open
ZZZJX0912 wants to merge 1 commit intomainfrom
DatePickerAbility
Open

DateTime add error render ability#888
ZZZJX0912 wants to merge 1 commit intomainfrom
DatePickerAbility

Conversation

@ZZZJX0912
Copy link
Collaborator

  1. 补充提供 error 状态渲染能力的DatePicker 代替 直接从 antd 中导出 AntdDatePicker
  2. 拓展 FieldsDateTime 的能力,不设置默认配置

自测截图

image image

@ZZZJX0912
Copy link
Collaborator Author

@netweng PTAL

github-actions[bot]
github-actions bot previously approved these changes Feb 24, 2025
@github-actions
Copy link
Contributor

Deploy preview for cloudtower-ui-kit-eagle ready!

✅ Preview
https://cloudtower-ui-kit-eagle-k8w1s61ad-webzard-io.vercel.app

Built with commit 96880ed.
This pull request is being automatically deployed with vercel-action

@@ -1,5 +1,5 @@
import {
DatePicker,
DatePicker as AntdDatePicker,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果是直接透穿的,那就叫 antdatepicker 就好了,原来的可以保持不变,不然这样其他使用 eagle 的地方一升级就 breaking change 了。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的

} from "antd";

export const DatePickerRangePicker = DatePicker.RangePicker;
export const DatePickerRangePicker = AntdDatePicker.RangePicker;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@@ -0,0 +1,28 @@
import { InputStyle } from "@src/core/Styled";
import { Typo } from "@src/core/Typo";
import { DatePicker as AntdDatePicker } from "antd";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新组件,为什么不能直接使用 antd5 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thread里有说,两种方案,要不就最小花销,只提供error的渲染能力,要不就直接引入antd5的组件,目前就最小花销的方式处理,我看thread里没有异议呀

}) => (
<div className="datatime-range">
<DatePicker.RangePicker
<AntdDatePicker.RangePicker
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为啥不用项目内的 datapicker ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,我全部处理一下,磨平AntdDatePicker 和 DatePicker的差异

toWeeklyString,
} from "@src/utils";
import { DatePicker } from "antd";
import { DatePicker as AntdDatePicker } from "antd";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@@ -5,7 +5,7 @@ import {
Checkbox as AntdCheckbox,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件不预期改动,只有还在用 useUIKit 这个废弃 hook 的地方才会用到

/**
* * antd4 组件
* * 更多 props 请参考:https://4x.ant.design/components/date-picker-cn/#API
* * 自定义 props 已在表格进行说明
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

看着也没说明吧?

Button as AntdButton,
Checkbox as AntdCheckbox,
Collapse as AntdCollapse,
DatePicker as AntdDatePicker,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里我就没太理解了,我们到底是对外提供项目内的 datapicker 还是 antd 的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants